<template>
    <div class="quiz">
        <Header style="z-index:1025">
            <header-menu></header-menu>
        </Header>
        <div class="main">
            <div class="quiz">
                <div class="quiz-top"><img src="../Quiz/img/quiz.png" alt=""></div><span class="tw">提问</span>
                <div class="quiz-content">
                    <textarea name="" id="" cols="30" rows="10">
                   你好？我想修复眼袋！我是2013年正月15做的现在眼下有皱纹！下踹！谢谢回复
                    </textarea>
                    <div class="menu">
                        <Tag v-for="item in count" :key="item" :name="item" closable @on-close="handleClose2">{{item}}</Tag>
                        <Button  icon="ios-add" type="dashed" size="small" @click="handleAdd">添加标签</Button>
                        <span>最多添加三个标签</span>
                    </div>
                </div>
                <div class="quiz-bottom">
                    <button>提交</button>
                </div>
            </div>

        </div>
        <bottom-icon></bottom-icon>
        <Footer>
            <page-footer></page-footer>
        </Footer>
    </div>
</template>

<script>
    import BottomIcon from '../../components/BottomIcon/'
    import PageFooter from '../../components/Footer/'
    import HeaderMenu from '@/components/Header/'
    export default {
        name: "index",
        components: {
            BottomIcon,
            PageFooter,
            HeaderMenu
        },
        data () {
            return {
                count: [''],

            }
        },
        methods: {
            handleAdd () {
                this.$Modal.confirm({
                    render: (h) => {
                        return h('Input', {
                            props: {
                                value: this.value,
                                autofocus: true,
                                placeholder: 'Please enter your name...'
                            },
                            on : {
                                input: (val) => {
                                    if (this.count.length<3) {
                                        this.count.push(val);
                                    }
                                }
                            }
                        })
                    }
                })


            },
            handleClose2 (event, name) {
                const index = this.count.indexOf(name);
                this.count.splice(index, 1);
            }
        }

    }





</script>

<style scoped lang="less">
.main{
    width: 1200px;
    margin: 0 auto;
    .quiz{
        width: 600px;
        margin: 120px auto;
    }
    .quiz .quiz-top{
        float: left;
    }
    .quiz .tw{
        display: block;
        float: left;
        font-size: 18px;
        color: #333333;
        margin-left: 10px;
        margin-bottom: 24px;
    }
    .quiz-content{
        clear: both;
        width: 600px;
        height: 240px;
        margin: 0px auto;
        border: solid 1px #dbdbdb;
    }
    textarea{
        width: 560px;
        height: 180px;
        margin-left: 20px;
        border: none;
        padding-top: 20px;
        outline: none;
        resize:none;
        border-bottom: 1px solid #eeeeee;
    }
    .menu{
        margin: 10px 0 0 50px;
    }
    .menu span{
        margin: 5px 0 0 60px;
        color: #999999;
        font-size: 14px;
    }
    .quiz-bottom button{
        width: 120px;
        height: 36px;
        background-color: #ff5371;
        border-radius: 4px;
        outline: none;
        border: none;
        color: #fff;
        margin-top: 40px;
    }

}
</style>